import requests,json
from jsonpath import jsonpath

proxies = {
    'http': '127.0.0.1:10809',
    'https': '127.0.0.1:10809',
}
headers = {
    "Accept": "application/json",
    "X-API-KEY": "7b952a836b484c5e84e8171757aa69f0"
}
for data in range(1, 10001):
    url = f"https://api.opensea.io/api/v1/assets?token_ids={data}&order_direction=desc&asset_contract_address=0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d&limit=200&include_orders=True"
    response = requests.get(url, headers=headers, proxies=proxies)
    response_data = json.loads(response.text)
    assets = jsonpath(response_data, "$..assets")[0][0]
    print(assets)
    token_id = jsonpath(response_data, "$..token_id")[0]
    image_url = jsonpath(response_data,"$..image_url")[0]
    background_color = jsonpath(response_data,"$..background_color")
    name = jsonpath(response_data,"$..name")[0]
    external_link = jsonpath(response_data,"$..external_link")[0]
    asset_contract = jsonpath(response_data,"$..asset_contract")
    owner = jsonpath(response_data,"$..owner")[0]
    # traits = jsonpath(response_data, '$..traits')[0]
    # last_sale = jsonpath(response_data, '$..last_sale')
    print(token_id)
    print(image_url)
    print(background_color)
    print(name)
    print(external_link)
    print(asset_contract)
    print(owner)
    print("==================================")
